import _ from "lodash";
import momen from "moment";
import "moment/locale/zh-cn";

const moment = (date) => {
  if (momen(date).isBefore(momen().subtract(7, "days"))) {
    return momen(date).format("YYYY-MM-DD");
  } else {
    //1小时前
    return momen(date).from(momen());
  }
};

export default { moment };
